package com.zhangtai.modules.service.credential;


import com.zhangtai.modules.dto.CredentialHangDto;
import com.zhangtai.modules.entity.credential.CredentialHangEntity;
import com.zhangtai.utils.PageResult;
import com.zhangtai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;


/**
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2020-10-15 15:22:38
 */

public interface CredentialHangService {

    @GetMapping("/findCredentialHangList")
    @ApiOperation(value = "分页查询")
    PageResult queryPage(@RequestParam(value = "keyword", required = false) String keyword,
                         @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                         @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    PageResult<CredentialHangDto> getHanglList(@RequestParam(value = "name", required = false) String name,
                                               @RequestParam(value = "status", required = false) List<Integer> status,
                                               @RequestParam(value = "orgIds", required = false) List<Long> orgIds,
                                               @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                               @RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize);

    void unVaildHang(@RequestParam(value = "credentialId", required = false) Long credentialId);

    @GetMapping("/infoCredentialHang")
    @ApiOperation(value = "根据id查找")
    CredentialHangEntity getByIdE(@RequestParam("id") Long id);

    @PostMapping("/saveCredentialHang")
    @ApiOperation(value = "保存")
    R saveE(@RequestBody CredentialHangEntity entity);

    @PostMapping("/updateCredentialHang")
    @ApiOperation(value = "修改")
    R updateByIdE(@RequestBody CredentialHangEntity entity);

    @GetMapping("/deleteOneCredentialHang")
    @ApiOperation(value = "根据ID删除")
    R removeOneById(@RequestParam("id") Long id);

    @PostMapping("/deleteCredentialHangs")
    @ApiOperation(value = "根据ID集合删除")
    R removeByIdsE(@RequestBody List<Long> ids);

    @GetMapping("/findByCredentialId")
    @ApiOperation(value = "根据id查找")
    CredentialHangEntity getByCredentialId(@RequestParam("credentialId") Long credentialId);
}

